import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { copyMatchingProperties } from '../../../common/utils/objectCopy';

export class UserVO {
  @ApiProperty({ description: '用户ID', example: 1 })
  id: number;

  @ApiProperty({ description: '用户名', example: 'john_doe' })
  username: string;

  @ApiPropertyOptional({ description: '昵称', example: 'John' })
  nickname?: string;

  @ApiPropertyOptional({
    description: '头像URL',
    example: 'https://example.com/avatar.jpg',
  })
  avatar?: string;

  constructor(partial: Partial<UserVO>) {
    copyMatchingProperties(this, partial);
  }
}
